POV-Ray : Newsgroups : povray.advanced-users : A macro I'm proud of I think (public Beta) : Re: A macro I'm proud of I think (public Beta) Server Time
29 Jul 2024 18:16:16 EDT (-0400)
  Re: A macro I'm proud of I think (public Beta)  
From: Wlodzimierz ABX Skiba
Date: 30 Apr 2001 08:04:23
Message: <3aed54c7@news.povray.org>
Dan Johnson wrote in message <3AEE7E92.6963DACB@hotmail.com>...
> A while ago I was working on a big complicated image, and I wanted to
> make a precise plane intersection shape far away from the origin.

Perhaps much better place for it's tutorial or scene-files groups.

> If you find any bugs or have suggestions, please comment.

I don't know how your macro works but I found that....

> #macro Sign (X) // Positive or negative 1 depending on the sign of X
>        (X/abs(X))
> #end

...could be more precise and still short

#macro Sign(P)
  (P>0?1:P<0?-1:0)
#end

also in megapov there is inclusion of Chris Chuff which builds-in function
sign() to available keywords

ABX


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.